//
// Created by xili on 2024/8/21 20:54.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    vector<int> numberOfPairs(vector<int> &nums) {
        int have[101] = {0};
        int ans = 0;
        for (auto &item: nums) {
            if (have[item]) {
                have[item]--;
                ans++;
            } else {
                have[item]++;
            }
        }
        return {ans, (int) nums.size() - 2 * ans};
    }
};